package org.game.db.bean;

import org.game.db.cache.RoleCache;
import static org.game.db.StaticResource.PlayerResource.PINGYING_COLUMN_NAMES;
import static org.game.db.StaticResource.PlayerResource.SOURCE_COLUMN_REMARKS;
import org.game.db.cache.RechargeOrderCache;
import static org.game.db.StaticResource.PlayerResource.FK_SOURCE_TABLE_NAMES;
import org.game.db.cache.TaskCache;
import org.game.db.cache.CommodityBuyRecordCache;
import org.game.db.cache.ElementCollectionCache;
import com.sojoys.artifact.tools.ToolMap;
import org.game.db.cache.DungeonLevelGroupCache;
import com.sojoys.artifact.tools.SK_Plus;
import org.game.db.cache.PlayerCache;
import java.sql.ResultSet;
import java.util.Map;
import org.game.db.cache.FormationCache;
import org.game.db.cache.PlayerStoreCache;
import org.game.db.cache.CityDatingRecordCache;
import com.sojoys.artifact.build.data.base.BasePojo;
import static org.game.db.StaticResource.PlayerResource.FK_PINGYING_COLUMN_NAMES;
import java.util.List;
import static org.game.db.StaticResource.PlayerResource.COLUMN_COUNT;
import static org.game.db.StaticResource.PlayerResource.COLUMN_BASICTYPES;
import com.sojoys.artifact.tools.ToolCopy;
import static org.game.db.StaticResource.PlayerResource.*;
import org.game.db.cache.DatingCache;
import org.game.db.cache.MailCache;
import org.game.db.cache.MonthCardCache;
import com.alibaba.fastjson.JSONObject;
import static org.game.db.StaticResource.PlayerResource.FK_HASHCODE_TABLE_NAMES;
import org.game.db.cache.HeroCache;
import org.game.db.cache.CurrentScriptRecordCache;
import com.sojoys.artifact.factory.bytebuff.IByteBuff;
import org.game.db.cache.BuildingCache;
import org.apache.commons.lang3.ArrayUtils;
import org.game.db.cache.ReserveDateRecordCache;
import org.game.db.cache.RechargeGiftBagRecordCache;
import static org.game.db.StaticResource.PlayerResource.FK_PINGYING_TABLE_NAMES;
import static org.game.db.StaticResource.PlayerResource.HASHCODE_COLUMN_NAMES;
import java.sql.SQLException;
import org.game.db.cache.PlayerDataCache;
import static org.game.db.StaticResource.PlayerResource.COLUMN_COLUMNTYPES;
import static org.game.db.StaticResource.PlayerResource.COLUMN_CLASSTYPES;
import org.game.db.cache.DungeonLevelCache;
import com.sojoys.artifact.constant.DataModelKeyEnum;
import org.game.db.cache.ItemCache;
import static org.game.db.StaticResource.PlayerResource.FK_SOURCE_COLUMN_NAMES;
import org.game.db.cache.PlayerActivityCache;
import org.game.db.cache.CityCache;
import org.game.db.cache.ComposeSummonCache;
import static org.game.db.StaticResource.PlayerResource.SOURCE_COLUMN_NAMES;
import static org.game.db.StaticResource.PlayerResource.FK_HASHCODE_COLUMN_NAMES;
import static org.game.db.StaticResource.PlayerResource.*;
/**
 * 玩家
 */
public class Player extends BasePojo<Player> {
	
	
	/**
	 * 索引值
	 */
	private String[] indexValues = new String[3];
	
	/**
	* id
	*/
	private int id;
	
	/**
	* create_date
	*/
	private java.util.Date createDate;
	
	/**
	* modified_date
	*/
	private java.util.Date modifiedDate;
	
	/**
	* 账号ID
	*/
	private String uid;
	
	/**
	* 语言
	*/
	private String language;
	
	/**
	* 昵称
	*/
	private String name;
	
	/**
	* 最后登录时间
	*/
	private java.util.Date lastLoginTime;
	
	/**
	* 等级
	*/
	private int level;
	
	/**
	* 玩家经验
	*/
	private long exp;
	
	/**
	* vip等级
	*/
	private int vipLevel;
	
	/**
	* VIP经验
	*/
	private long vipExp;
	
	/**
	* 宣言
	*/
	private String remark;
	
	/**
	* 是否是预创建账号
	*/
	private boolean pre;
	
	/**
	* 注册时间
	*/
	private java.util.Date registerDate;
	
	/**
	* 充值总钻石
	*/
	private int rechargeTotalDiamond;
	
	
	@Deprecated
	public static Player builder() {
		Player player = new Player();
		return player;
	}
	
	@Deprecated
	public Player() {
		super();
	}
	
	public Player(int id, String uid, String language, String name, java.util.Date lastLoginTime, int level, long exp, int vipLevel, long vipExp, String remark, boolean pre, java.util.Date registerDate, int rechargeTotalDiamond) {
		super();
		this.id = id;
		this.createDate = new java.util.Date();
		this.modifiedDate = new java.util.Date();
		this.uid = uid;
		this.language = language;
		this.name = name;
		this.lastLoginTime = lastLoginTime;
		this.level = level;
		this.exp = exp;
		this.vipLevel = vipLevel;
		this.vipExp = vipExp;
		this.remark = remark;
		this.pre = pre;
		this.registerDate = registerDate;
		this.rechargeTotalDiamond = rechargeTotalDiamond;
	}
	
	/**
	 * id
	 */
	public int getId() {return id;}
	
	/**
	 * id
	 */
	public Player setId(int id) {this.id = id;return this;}
	
	/**
	 * create_date
	 */
	public java.util.Date getCreateDate() {return createDate;}
	
	/**
	 * create_date
	 */
	protected Player setCreateDate(java.util.Date createDate) {this.createDate = createDate;return this;}
	
	/**
	 * modified_date
	 */
	public java.util.Date getModifiedDate() {return modifiedDate;}
	
	/**
	 * modified_date
	 */
	protected Player setModifiedDate(java.util.Date modifiedDate) {this.modifiedDate = modifiedDate;return this;}
	
	/**
	 * 账号ID
	 */
	public String getUid() {return uid;}
	
	/**
	 * 账号ID
	 */
	public Player setUid(String uid) {this.uid = uid;return this;}
	
	/**
	 * 语言
	 */
	public String getLanguage() {return language;}
	
	/**
	 * 语言
	 */
	public Player setLanguage(String language) {this.language = language;return this;}
	
	/**
	 * 昵称
	 */
	public String getName() {return name;}
	
	/**
	 * 昵称
	 */
	public Player setName(String name) {this.name = name;return this;}
	
	/**
	 * 最后登录时间
	 */
	public java.util.Date getLastLoginTime() {return lastLoginTime;}
	
	/**
	 * 最后登录时间
	 */
	public Player setLastLoginTime(java.util.Date lastLoginTime) {this.lastLoginTime = lastLoginTime;return this;}
	
	/**
	 * 等级
	 */
	public int getLevel() {return level;}
	
	/**
	 * 等级
	 */
	public Player setLevel(int level) {this.level = level;return this;}
	
	/**
	 * 玩家经验
	 */
	public long getExp() {return exp;}
	
	/**
	 * 玩家经验
	 */
	public Player setExp(long exp) {this.exp = exp;return this;}
	
	/**
	 * vip等级
	 */
	public int getVipLevel() {return vipLevel;}
	
	/**
	 * vip等级
	 */
	public Player setVipLevel(int vipLevel) {this.vipLevel = vipLevel;return this;}
	
	/**
	 * VIP经验
	 */
	public long getVipExp() {return vipExp;}
	
	/**
	 * VIP经验
	 */
	public Player setVipExp(long vipExp) {this.vipExp = vipExp;return this;}
	
	/**
	 * 宣言
	 */
	public String getRemark() {return remark;}
	
	/**
	 * 宣言
	 */
	public Player setRemark(String remark) {this.remark = remark;return this;}
	
	/**
	 * 是否是预创建账号
	 */
	public boolean isPre() {return pre;}
	
	/**
	 * 是否是预创建账号
	 */
	public Player setPre(boolean pre) {this.pre = pre;return this;}
	
	/**
	 * 注册时间
	 */
	public java.util.Date getRegisterDate() {return registerDate;}
	
	/**
	 * 注册时间
	 */
	public Player setRegisterDate(java.util.Date registerDate) {this.registerDate = registerDate;return this;}
	
	/**
	 * 充值总钻石
	 */
	public int getRechargeTotalDiamond() {return rechargeTotalDiamond;}
	
	/**
	 * 充值总钻石
	 */
	public Player setRechargeTotalDiamond(int rechargeTotalDiamond) {this.rechargeTotalDiamond = rechargeTotalDiamond;return this;}
	
	
	// 代理
	private org.game.db.proxy.bean.PlayerProxy playerProxy = new org.game.db.proxy.bean.PlayerProxy().build(this);
	
	public org.game.db.proxy.bean.PlayerProxy getPlayerProxy(){return playerProxy;}
	
	
	protected Object[] getColumnNames(DataModelKeyEnum e){
		switch (e) {
		case SOURCE:
			return SOURCE_COLUMN_NAMES;
		case PINGYING:
			return PINGYING_COLUMN_NAMES;
		case HASHCODE:
			return HASHCODE_COLUMN_NAMES;
		case REMARKS:
			return SOURCE_COLUMN_REMARKS;
		default:
			return PINGYING_COLUMN_NAMES;
		}
	}
	
	protected Object[] getFKTableNames(DataModelKeyEnum e){
		switch (e) {
		case SOURCE:
			return FK_SOURCE_TABLE_NAMES;
		case PINGYING:
			return FK_PINGYING_TABLE_NAMES;
		case HASHCODE:
			return FK_HASHCODE_TABLE_NAMES;
		default:
			return FK_PINGYING_TABLE_NAMES;
		}
	}
	
	protected Object[] getFKColumnNames(DataModelKeyEnum e){
		switch (e) {
		case SOURCE:
			return FK_SOURCE_COLUMN_NAMES;
		case PINGYING:
			return FK_PINGYING_COLUMN_NAMES;
		case HASHCODE:
			return FK_HASHCODE_COLUMN_NAMES;
		default:
			return FK_PINGYING_TABLE_NAMES;
		}
	}
	
	protected String[] getBasicTypes(){
		return COLUMN_BASICTYPES;
	}
	
	protected Class[] getClassTypes(){
		return COLUMN_CLASSTYPES;
	}
	
	protected String[] getColumnTypes(){
		return COLUMN_COLUMNTYPES;
	}
	
	protected int getColumnCount(){
		return COLUMN_COUNT;
	}
	
	protected Object[] getColumeValues(){
		Object[] values = new Object[COLUMN_COUNT];
        values[0] = this.id;
        values[1] = this.createDate;
        values[2] = this.modifiedDate;
        values[3] = this.uid;
        values[4] = this.language;
        values[5] = this.name;
        values[6] = this.lastLoginTime;
        values[7] = this.level;
        values[8] = this.exp;
        values[9] = this.vipLevel;
        values[10] = this.vipExp;
        values[11] = this.remark;
        values[12] = this.pre;
        values[13] = this.registerDate;
        values[14] = this.rechargeTotalDiamond;
        return values;
	}
	
	public Player deepCopy(){
		Player player = null;
		try {
			player = (Player) super.clone();
		    player.setCreateDate(ToolCopy.copyObject(this.createDate));
		    player.setModifiedDate(ToolCopy.copyObject(this.modifiedDate));
		    player.setLastLoginTime(ToolCopy.copyObject(this.lastLoginTime));
		    player.setRegisterDate(ToolCopy.copyObject(this.registerDate));
		    // 克隆索引
		    player.indexValues = ArrayUtils.clone(indexValues);
			return player;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return player;
	}
	
	
	protected Map<Object, Object> toMap(Object[] keys,Map<Object, Object> map){
        map.put(keys[0], this.id);
        map.put(keys[1], this.createDate);
        map.put(keys[2], this.modifiedDate);
        map.put(keys[3], this.uid);
        map.put(keys[4], this.language);
        map.put(keys[5], this.name);
        map.put(keys[6], this.lastLoginTime);
        map.put(keys[7], this.level);
        map.put(keys[8], this.exp);
        map.put(keys[9], this.vipLevel);
        map.put(keys[10], this.vipExp);
        map.put(keys[11], this.remark);
        map.put(keys[12], this.pre);
        map.put(keys[13], this.registerDate);
        map.put(keys[14], this.rechargeTotalDiamond);
        return map;
    }
    
    protected Player createForMap(Object[] keys,Map map){
   		this.id = (int)map.get(keys[0]);
   		this.createDate = (java.util.Date)map.get(keys[1]);
   		this.modifiedDate = (java.util.Date)map.get(keys[2]);
   		this.uid = (String)map.get(keys[3]);
   		this.language = (String)map.get(keys[4]);
   		this.name = (String)map.get(keys[5]);
   		this.lastLoginTime = (java.util.Date)map.get(keys[6]);
   		this.level = (int)map.get(keys[7]);
   		this.exp = (long)map.get(keys[8]);
   		this.vipLevel = (int)map.get(keys[9]);
   		this.vipExp = (long)map.get(keys[10]);
   		this.remark = (String)map.get(keys[11]);
   		this.pre = (boolean)map.get(keys[12]);
   		this.registerDate = (java.util.Date)map.get(keys[13]);
   		this.rechargeTotalDiamond = (int)map.get(keys[14]);
        return this;
    }
	
	
	protected JSONObject toJSONObject(Object[] keys,JSONObject obj){
        obj.put(keys[0], this.id);
        obj.put(keys[1], this.createDate);
        obj.put(keys[2], this.modifiedDate);
        obj.put(keys[3], this.uid);
        obj.put(keys[4], this.language);
        obj.put(keys[5], this.name);
        obj.put(keys[6], this.lastLoginTime);
        obj.put(keys[7], this.level);
        obj.put(keys[8], this.exp);
        obj.put(keys[9], this.vipLevel);
        obj.put(keys[10], this.vipExp);
        obj.put(keys[11], this.remark);
        obj.put(keys[12], this.pre);
        obj.put(keys[13], this.registerDate);
        obj.put(keys[14], this.rechargeTotalDiamond);
        return obj;
    }
    
    protected Player createForJSONObject(Object[] keys,JSONObject obj){
	    this.id = obj.getIntValue(keys[0]);
	    this.createDate = obj.getDate(keys[1]);
	    this.modifiedDate = obj.getDate(keys[2]);
	    this.uid = obj.getString(keys[3]);
	    this.language = obj.getString(keys[4]);
	    this.name = obj.getString(keys[5]);
	    this.lastLoginTime = obj.getDate(keys[6]);
	    this.level = obj.getIntValue(keys[7]);
	    this.exp = obj.getLongValue(keys[8]);
	    this.vipLevel = obj.getIntValue(keys[9]);
	    this.vipExp = obj.getLongValue(keys[10]);
	    this.remark = obj.getString(keys[11]);
	    this.pre = obj.getBooleanValue(keys[12]);
	    this.registerDate = obj.getDate(keys[13]);
	    this.rechargeTotalDiamond = obj.getIntValue(keys[14]);
        return this;
    }
    
    
    public Player createForResultSet(ResultSet rs) throws SQLException{
	    this.id = rs.getInt(SOURCE_COLUMN_NAMES[0]);
	    this.createDate = rs.getTimestamp(SOURCE_COLUMN_NAMES[1]);
	    this.modifiedDate = rs.getTimestamp(SOURCE_COLUMN_NAMES[2]);
	    this.uid = rs.getString(SOURCE_COLUMN_NAMES[3]);
	    this.language = rs.getString(SOURCE_COLUMN_NAMES[4]);
	    this.name = rs.getString(SOURCE_COLUMN_NAMES[5]);
	    this.lastLoginTime = rs.getTimestamp(SOURCE_COLUMN_NAMES[6]);
	    this.level = rs.getInt(SOURCE_COLUMN_NAMES[7]);
	    this.exp = rs.getLong(SOURCE_COLUMN_NAMES[8]);
	    this.vipLevel = rs.getInt(SOURCE_COLUMN_NAMES[9]);
	    this.vipExp = rs.getLong(SOURCE_COLUMN_NAMES[10]);
	    this.remark = rs.getString(SOURCE_COLUMN_NAMES[11]);
	    this.pre = rs.getBoolean(SOURCE_COLUMN_NAMES[12]);
	    this.registerDate = rs.getTimestamp(SOURCE_COLUMN_NAMES[13]);
	    this.rechargeTotalDiamond = rs.getInt(SOURCE_COLUMN_NAMES[14]);
	    return this;
    }
    
    protected void writeBytes(IByteBuff byteBuf){
	    byteBuf.writeInt(this.id);
	    byteBuf.writeDate(this.createDate);
	    byteBuf.writeDate(this.modifiedDate);
	    byteBuf.writeString(this.uid);
	    byteBuf.writeString(this.language);
	    byteBuf.writeString(this.name);
	    byteBuf.writeDate(this.lastLoginTime);
	    byteBuf.writeInt(this.level);
	    byteBuf.writeLong(this.exp);
	    byteBuf.writeInt(this.vipLevel);
	    byteBuf.writeLong(this.vipExp);
	    byteBuf.writeString(this.remark);
	    byteBuf.writeBoolean(this.pre);
	    byteBuf.writeDate(this.registerDate);
	    byteBuf.writeInt(this.rechargeTotalDiamond);
    }
	
	protected Player readBytes(IByteBuff byteBuf){
	    this.id = byteBuf.readInt(null);
	    this.createDate = byteBuf.readDate(null);
	    this.modifiedDate = byteBuf.readDate(null);
	    this.uid = byteBuf.readString(null);
	    this.language = byteBuf.readString(null);
	    this.name = byteBuf.readString(null);
	    this.lastLoginTime = byteBuf.readDate(null);
	    this.level = byteBuf.readInt(null);
	    this.exp = byteBuf.readLong(null);
	    this.vipLevel = byteBuf.readInt(null);
	    this.vipExp = byteBuf.readLong(null);
	    this.remark = byteBuf.readString(null);
	    this.pre = byteBuf.readBoolean(null);
	    this.registerDate = byteBuf.readDate(null);
	    this.rechargeTotalDiamond = byteBuf.readInt(null);
	    return this;
	}
    
    
    protected JSONObject exportFKTableMap(Object[] keys,JSONObject map,DataModelKeyEnum e){
		// building
		map.put(keys[0],exprotHelp(this.getBuildingsFkPlayerId(),e));
		// city
		map.put(keys[1],exprotHelp(this.getCitysFkPlayerId(),e));
		// city_dating_record
		map.put(keys[2],exprotHelp(this.getCityDatingRecordsFkPlayerId(),e));
		// commodity_buy_record
		map.put(keys[3],exprotHelp(this.getCommodityBuyRecordsFkPlayerId(),e));
		// compose_summon
		map.put(keys[4],exprotHelp(this.getComposeSummonsFkPlayerId(),e));
		// current_script_record
		map.put(keys[5],exprotHelp(this.getCurrentScriptRecordsFkPlayerId(),e));
		// dating
		map.put(keys[6],exprotHelp(this.getDatingsFkPlayerId(),e));
		// dungeon_level
		map.put(keys[7],exprotHelp(this.getDungeonLevelsFkPlayerId(),e));
		// dungeon_level_group
		map.put(keys[8],exprotHelp(this.getDungeonLevelGroupsFkPlayerId(),e));
		// element_collection
		map.put(keys[9],exprotHelp(this.getElementCollectionsFkPlayerId(),e));
		// formation
		map.put(keys[10],exprotHelp(this.getFormationsFkPlayerId(),e));
		// hero
		map.put(keys[11],exprotHelp(this.getHerosFkPlayerId(),e));
		// item
		map.put(keys[12],exprotHelp(this.getItemsFkPlayerId(),e));
		// mail
		map.put(keys[13],exprotHelp(this.getMailsFkPlayerId(),e));
		// month_card
		map.put(keys[14],exprotHelp(this.getMonthCardsFkPlayerId(),e));
		// player_activity
		map.put(keys[15],exprotHelp(this.getPlayerActivitysFkPlayerId(),e));
		// player_data
		map.put(keys[16],exprotHelp(this.getPlayerDatasFkPlayerId(),e));
		// player_store
		map.put(keys[17],exprotHelp(this.getPlayerStoresFkPlayerId(),e));
		// recharge_gift_bag_record
		map.put(keys[18],exprotHelp(this.getRechargeGiftBagRecordsFkPlayerId(),e));
		// recharge_order
		map.put(keys[19],exprotHelp(this.getRechargeOrdersFkPlayerId(),e));
		// reserve_date_record
		map.put(keys[20],exprotHelp(this.getReserveDateRecordsFkPlayerId(),e));
		// role
		map.put(keys[21],exprotHelp(this.getRolesFkPlayerId(),e));
		// task
		map.put(keys[22],exprotHelp(this.getTasksFkPlayerId(),e));
        return map;
    }
    
    protected boolean importFKTableMap(Object[] keys,JSONObject map,DataModelKeyEnum e){
		// building
		improtHelp(map.getJSONArray(keys[0]),Building.builder(),e,0,this.getId());
		// city
		improtHelp(map.getJSONArray(keys[1]),City.builder(),e,1,this.getId());
		// city_dating_record
		improtHelp(map.getJSONArray(keys[2]),CityDatingRecord.builder(),e,2,this.getId());
		// commodity_buy_record
		improtHelp(map.getJSONArray(keys[3]),CommodityBuyRecord.builder(),e,3,this.getId());
		// compose_summon
		improtHelp(map.getJSONArray(keys[4]),ComposeSummon.builder(),e,4,this.getId());
		// current_script_record
		improtHelp(map.getJSONArray(keys[5]),CurrentScriptRecord.builder(),e,5,this.getId());
		// dating
		improtHelp(map.getJSONObject(keys[6]),Dating.builder(),e,6,this.getId());
		// dungeon_level
		improtHelp(map.getJSONArray(keys[7]),DungeonLevel.builder(),e,7,this.getId());
		// dungeon_level_group
		improtHelp(map.getJSONArray(keys[8]),DungeonLevelGroup.builder(),e,8,this.getId());
		// element_collection
		improtHelp(map.getJSONObject(keys[9]),ElementCollection.builder(),e,9,this.getId());
		// formation
		improtHelp(map.getJSONArray(keys[10]),Formation.builder(),e,10,this.getId());
		// hero
		improtHelp(map.getJSONArray(keys[11]),Hero.builder(),e,11,this.getId());
		// item
		improtHelp(map.getJSONArray(keys[12]),Item.builder(),e,12,this.getId());
		// mail
		improtHelp(map.getJSONArray(keys[13]),Mail.builder(),e,13,this.getId());
		// month_card
		improtHelp(map.getJSONObject(keys[14]),MonthCard.builder(),e,14,this.getId());
		// player_activity
		improtHelp(map.getJSONArray(keys[15]),PlayerActivity.builder(),e,15,this.getId());
		// player_data
		improtHelp(map.getJSONObject(keys[16]),PlayerData.builder(),e,16,this.getId());
		// player_store
		improtHelp(map.getJSONArray(keys[17]),PlayerStore.builder(),e,17,this.getId());
		// recharge_gift_bag_record
		improtHelp(map.getJSONArray(keys[18]),RechargeGiftBagRecord.builder(),e,18,this.getId());
		// recharge_order
		improtHelp(map.getJSONArray(keys[19]),RechargeOrder.builder(),e,19,this.getId());
		// reserve_date_record
		improtHelp(map.getJSONArray(keys[20]),ReserveDateRecord.builder(),e,20,this.getId());
		// role
		improtHelp(map.getJSONArray(keys[21]),Role.builder(),e,21,this.getId());
		// task
		improtHelp(map.getJSONArray(keys[22]),Task.builder(),e,22,this.getId());
		return true;
    }
    
	/** 取得[building] */
	public List<Building> getBuildingsFkPlayerId(){
		return BuildingCache.me().getByPlayerId(id);
	}
	
	/** 取得[city] */
	public List<City> getCitysFkPlayerId(){
		return CityCache.me().getByPlayerId(id);
	}
	
	/** 取得[city_dating_record] */
	public List<CityDatingRecord> getCityDatingRecordsFkPlayerId(){
		return CityDatingRecordCache.me().getByPlayerId(id);
	}
	
	/** 取得[commodity_buy_record] */
	public List<CommodityBuyRecord> getCommodityBuyRecordsFkPlayerId(){
		return CommodityBuyRecordCache.me().getByPlayerId(id);
	}
	
	/** 取得[compose_summon] */
	public List<ComposeSummon> getComposeSummonsFkPlayerId(){
		return ComposeSummonCache.me().getByPlayerId(id);
	}
	
	/** 取得[current_script_record] */
	public List<CurrentScriptRecord> getCurrentScriptRecordsFkPlayerId(){
		return CurrentScriptRecordCache.me().getByPlayerId(id);
	}
	
	/** 取得[dating] */
	public Dating getDatingsFkPlayerId(){
		return DatingCache.me().getByPlayerId(id);
	}
	
	/** 取得[dungeon_level] */
	public List<DungeonLevel> getDungeonLevelsFkPlayerId(){
		return DungeonLevelCache.me().getByPlayerId(id);
	}
	
	/** 取得[dungeon_level_group] */
	public List<DungeonLevelGroup> getDungeonLevelGroupsFkPlayerId(){
		return DungeonLevelGroupCache.me().getByPlayerId(id);
	}
	
	/** 取得[element_collection] */
	public ElementCollection getElementCollectionsFkPlayerId(){
		return ElementCollectionCache.me().getByPlayerId(id);
	}
	
	/** 取得[formation] */
	public List<Formation> getFormationsFkPlayerId(){
		return FormationCache.me().getByPlayerId(id);
	}
	
	/** 取得[hero] */
	public List<Hero> getHerosFkPlayerId(){
		return HeroCache.me().getByPlayerId(id);
	}
	
	/** 取得[item] */
	public List<Item> getItemsFkPlayerId(){
		return ItemCache.me().getByPlayerId(id);
	}
	
	/** 取得[mail] */
	public List<Mail> getMailsFkPlayerId(){
		return MailCache.me().getByPlayerId(id);
	}
	
	/** 取得[month_card] */
	public MonthCard getMonthCardsFkPlayerId(){
		return MonthCardCache.me().getByPlayerId(id);
	}
	
	/** 取得[player_activity] */
	public List<PlayerActivity> getPlayerActivitysFkPlayerId(){
		return PlayerActivityCache.me().getByPlayerId(id);
	}
	
	/** 取得[player_data] */
	public PlayerData getPlayerDatasFkPlayerId(){
		return PlayerDataCache.me().getByPlayerId(id);
	}
	
	/** 取得[player_store] */
	public List<PlayerStore> getPlayerStoresFkPlayerId(){
		return PlayerStoreCache.me().getByPlayerId(id);
	}
	
	/** 取得[recharge_gift_bag_record] */
	public List<RechargeGiftBagRecord> getRechargeGiftBagRecordsFkPlayerId(){
		return RechargeGiftBagRecordCache.me().getByPlayerId(id);
	}
	
	/** 取得[recharge_order] */
	public List<RechargeOrder> getRechargeOrdersFkPlayerId(){
		return RechargeOrderCache.me().getByPlayerId(id);
	}
	
	/** 取得[reserve_date_record] */
	public List<ReserveDateRecord> getReserveDateRecordsFkPlayerId(){
		return ReserveDateRecordCache.me().getByPlayerId(id);
	}
	
	/** 取得[role] */
	public List<Role> getRolesFkPlayerId(){
		return RoleCache.me().getByPlayerId(id);
	}
	
	/** 取得[task] */
	public List<Task> getTasksFkPlayerId(){
		return TaskCache.me().getByPlayerId(id);
	}
	
	
    /** 级联删除(延迟入库) */
    public boolean deleteAndSon(){
    	return false;
    }
    
    /** 级联删除(及时入库) */
    public boolean deleteAndSonAndFlush(){
    	return false;
    }
    
    /** 延迟插入数据库 */
    public Player insert(){
    	return PlayerCache.me().insert(this);
    }
    /** 延迟更新数据库 */
    public Player update(){
    	return PlayerCache.me().update(this);
    }
    /** 延迟删除数据库 */
    public boolean delete(){
    	return PlayerCache.me().delete(this);
    }
    /** 即时插入数据库 */
    public Player insertAndFlush(){
    	return PlayerCache.me().insertAndFlush(this);
    }
    /** 即时更新数据库 */
    public Player updateAndFlush(){
    	return PlayerCache.me().updateAndFlush(this);
    }
    /** 即时删除数据库 */
    public boolean deleteAndFlush(){
    	return PlayerCache.me().deleteAndFlush(this);
    }
    
    
	
	/**
	 * 同步索引值
	 */
	public Player syncIndexValues(){
		indexValues[0] = SK_Plus.b(getId()).e();
		indexValues[1] = SK_Plus.b(getUid()).e();
		indexValues[2] = SK_Plus.b(isPre()).e();
		return this;
	}
	/**
	 * 取得索引
	 */
	public String[] getIndexValues(){
		return indexValues;
	}
	
	protected Object getPrimaryKey(){
		return getId();
	}
	
	protected void setPrimaryKey(Object key){
		setId((int)key);
	}
//自定义内容起始位置
//自定义内容结束位置
}